<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>无标题页</title>
<link rel="stylesheet" type="text/css" href="../Admin/role/css/index.css">
<script src="../Admin/role/js/jquery-1.7.1.min.js"></script>
</head>
<body class="mian_bj">
<div class="mian_top_01">
<div class="mian_top_r"></div>
<div class="mian_top_l"></div>
<div class="mian_top_c">

</div>
<div class="mian_b">
<div class="mian_b1">
<a class="mian_b1_a1" href="addProjectMessageLiu.action" title="添加"></a>
<a class="mian_b1_a2" a href="javascript:void(0)" onclick="del()" title="删除"></a>
<p class="mian_b1_sousuo"><input id="name" name="name" type="text" placeholder="请输入项目名称" value=""></p>
<a onclick="selectLike()"  class="mian_b1_a3"></a>
<a href="#" title="最后" class="mian_b1_a4"></a>
<a href="#" title="下一页" class="mian_b1_a5"></a>
<p class="mian_b1_list">1 2 3 4……</p>
<a href="#" title="上一页" class="mian_b1_a6"></a>
<a href="#" title="最前" class="mian_b1_a7"></a>
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="mian_b_bg">
<tr>
<td width="3%" class="mian_b_bg_lm"><input name="" type="checkbox" value="">&nbsp;</td>
<td width="11%" class="mian_b_bg_lm"><span></span>排序ID</td>
<td width="10%" class="mian_b_bg_lm"><span></span>项目名称</td>
<td width="20%" class="mian_b_bg_lm"><span></span>开始时间</td>
<td width="20%" class="mian_b_bg_lm"><span></span>结束时间</td>
<td width="20%" class="mian_b_bg_lm"><span></span>项目负责人</td>
<td width="20%" class="mian_b_bg_lm"><span></span>编辑</td>
</tr>
<tr>
  
    <c:forEach var="plist" items="${projects}">
    <tr>
						<td><input name=id type="checkbox" value="${plist.id}">&nbsp;</td>
						<td>${plist.id}</td>
						<td>${plist.name}</td>	
						<td><fmt:formatDate value="${plist.begintime}" pattern="yyyy-MM-dd"/></td>	
						<td><fmt:formatDate value="${plist.endtime}" pattern="yyyy-MM-dd"/></td>
						<td>${plist.useraccount}</td>	
						<td width="8%" class="mian_b_icon_01"><a href="../project/updateProjectMessageLiu.action?id=${plist.id}">编辑</a></td>				
    </tr> 
	</c:forEach>


</tr>
</table>
</div>
</div>
</body>
<script type="text/javascript"> 
	
	function del() {
		var id="";
		var value = document.body.querySelectorAll("input[type='checkbox']");
		for (var i = 0; i < value.length; i++) {
			if (value[i].checked) {
				var temp = value[i].value;
				if (temp != null) {
					id +=temp+",";
				}

			}
			
		}
		if (confirm("确定要删除吗")) {
			location.href = "../project/deleteProjectByIdLiu.action?id=" + id;
		}
	}
		
	function selectLike() {
     var name = document.getElementById("name").value; 
     location.href = "selectAllProjectLiu.action?name=" + name;
		
	}
		
</script>
</html>